#include <buola/gui.h>

#include <buola/gui/dnd/cdrop.h>
#include <buola/gui/ctoolkit.h>

namespace buola { namespace gui {

CDrop::CDrop()
{
    mImpl=get_toolkit()->GetDropImpl(this);
    SetDropTarget(nullptr);
}

//We won't know the target until we receive the DndPosition message,
//but we must create the CDrop object when receiving the DndEnter

void CDrop::SetDropTarget(CDropTarget *pTarget)
{
    mTarget=pTarget;
    mAccepted=false;
    mAcceptedActions=DND_COPY;
}

void CDrop::Accept()
{
    mAccepted=true;
}

void CDrop::Reject()
{
    mAccepted=false;
}

void CDrop::Finish(bool /*pSuccess*/)
{
    //TODO:
}

void CDrop::SetValidActions(EDNDActions pActions)
{
    mAcceptedActions=pActions;
}

/*namespace gui*/ } /*namespace buola*/ }
